import 'package:flutter/material.dart';

MaterialButton createButton(
    {String text = "确定",
    Color backgroundColor = Colors.blue,
    Color textColor = Colors.white,
    FontWeight fontWeight = FontWeight.normal,
    double minWidth = 120,
    double height = 40,
    double fontSize = 16,
    Widget child,
    VoidCallback onPressed}) {
  if (child == null) {
    child = new Text(text,
        softWrap: true,
        overflow: TextOverflow.ellipsis,
        maxLines: 100,
        textAlign: TextAlign.center,
        style: new TextStyle(
            height: 1, fontSize: fontSize, fontWeight: fontWeight));
  }

  return new MaterialButton(
    color: backgroundColor,
    textColor: textColor,
    minWidth: minWidth,
    height: height,
    child: child,
    onPressed: onPressed,
  );
}
